interface FormItemProps {
  id?: number;
  /** 用于判断是`新增`还是`修改` */
  title: string;
  nickname: string;
  username: string;
  password: string;
  phone: string | number;
  email: string;
  sex: string | number;
  status: number;
  real_name?: string;
  birthday?: string;
  address?: string;
  introduction?: string;
  avatar?: string;
}

// 用户数据接口，对应后端返回的用户信息
interface UserData {
  id: number;
  username: string;
  email?: string;
  phone?: string;
  created_at?: string;
  status: number;
  nickname?: string;
  real_name?: string;
  sex?: number;
  address?: string;
  introduction?: string;
  last_login_at?: string;
  last_login_ip?: string;
  birthday?: string;
  avatar?: string;
  mfa_secret?: string;
  roles?: Array<{
    id: number;
    code: string;
    name: string;
  }>;
}
interface FormProps {
  formInline: FormItemProps;
}

interface RoleFormItemProps {
  username: string;
  nickname: string;
  /** 角色列表 */
  roleOptions: any[];
  /** 选中的角色列表 */
  ids: number[];
}
interface RoleFormProps {
  formInline: RoleFormItemProps;
}

export type { FormItemProps, FormProps, RoleFormItemProps, RoleFormProps, UserData };
